package com.ccb.sc.common.modules.order.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @version 1.0
 * @date 2020-09-25
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum CommentStatus implements IEnum<Integer> {

    /**
     * 待评价
     */
    WAIT_COMMENT(0, "待评价"),

    /**
     * 已评价
     */
    COMMENT(1, "已评价"),

    ;

    private int value;
    private String desc;

    CommentStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static CommentStatus getByValue(int value) {
        for (CommentStatus orderStatus : CommentStatus.values()) {
            if (value == orderStatus.getValue()) {
                return orderStatus;
            }
        }
        return null;
    }
}
